//有状态的登录页面
import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';

class HomePage extends StatefulWidget {
  const HomePage({super.key});
  @override
  State<HomePage> createState() => _HomePage();
}

class _HomePage extends State<HomePage> {
  @override
  void initState() async {
    super.initState();
    var storage = FlutterSecureStorage();
  var token =   await storage.read(key: 'userToken');
  print('___$token');
  }

  @override
  Widget build(BuildContext context) {
    // var args = ModalRoute.of(context)?.settings.arguments as Map;

    return Scaffold(
      //顶部状态了
      appBar: AppBar(
        // title: Text('首页-${widget.userName}', style: TextStyle(color: Colors.white)),
        title: Text('首页'),
        automaticallyImplyLeading: false,
        leading: Icon(Icons.home),
        // backgroundColor: Uiconstants.COLOR_THEME_GREEN,
      ),
      //页面主体
      body: Center(
        child: Column(
          children: [
            Text('社区首页', style: Theme.of(context).textTheme.headlineLarge),
            ElevatedButton(
              onPressed: () {
                Navigator.of(context).pop();
              },
              child: Text('返回'),
            ),
          ],
        ),
      ),
      //底部导航栏、页签栏
      // 右下角悬浮按钮
      // 左侧抽屉
      // 右侧抽屉
    );
  }
}
